//
//  GYBaseNavigationController.m
//  Visitor
//
//  Created by x on 2017/9/11.
//  Copyright © 2017年 HLB. All rights reserved.
//

#import "GYBaseNavigationController.h"

@interface GYBaseNavigationController ()

@end

@implementation GYBaseNavigationController
+ (void)initialize
{
    UINavigationBar *navBar = [UINavigationBar appearance];
    //更改导航栏的半透明状态
    navBar.translucent = NO;
    //设置属性
    NSDictionary *dict = @{NSForegroundColorAttributeName:[UIColor whiteColor],
                           NSFontAttributeName:[UIFont systemFontOfSize:18],
                           };
    [navBar setTitleTextAttributes:dict];
    navBar.tintColor = [UIColor whiteColor];
    navBar.barTintColor = RGBColor(0X3A9DF1);
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

/**
 设置状态栏的格式

 @return <#return value description#>
 */
- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    //导航控制器的根控制器不算导航控制器里面的子控制器
    if (self.childViewControllers.count > 0) {
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithBack:@"icon_return_nor" HightImage:@"icon_return_pre" Target:self action:@selector(back)];
        }
    [super pushViewController:viewController animated:animated];
}
- (void)back
{
    [self popViewControllerAnimated:YES];
}
@end
